<%@ page language="java" pageEncoding="UTF-8"%><%@ include
	file="/WEB-INF/commons/taglibs.jsp"%>
<!-- 如果session中用户名为空，跳转到登录页面 -->
<%@ page import="com.google.appengine.api.users.User"%>
<%@ page import="com.google.appengine.api.users.UserService"%>
<%@ page import="com.google.appengine.api.users.UserServiceFactory"%>
<%
	UserService userService = UserServiceFactory.getUserService();
	User user = userService.getCurrentUser();
	if (user == null) {
		response.sendRedirect(userService.createLoginURL("/myFlows"));
	}
%>
<!-- Flow展示区 -->
<script type="text/javascript">
$(function(){
	$('a[class$="add-a-flow"]').click(function(){
		var packId=$(this).attr("packId");
		window.location.href="/flows/create?packId="+packId;
	});
	$('a[class$="share-pack"]').click(function(){});
});
</script>
<table>
	<tr>
		<td><%@ include file="/WEB-INF/commons/flows.jsp"%></td>
		<td>
		<div id="flowsNav">
		<div class="navContainer">
		<form id="packageForm" action="<c:url value="/myFlows/pack/crt"/>"
			method="post"><input id="name" name="name" type="text" /><input
			type="submit" value="创建流程包" /></form>
		<p class="title">流程包列表</p>
		<ul>
			<c:forEach var="e" items="${it.packs}">
				<li>
				<p class="name"><a href="<c:url value="/myFlows/${e.id}"/>">${e.name}</a>&nbsp;<a
					href="#" title="Add a flow" packId="${e.id}"
					class="ui-icon ui-icon-plus add-a-flow">Add a flow</a></p>
				<p class="info"><fmt:formatDate value="${e.crtDate}"
					pattern="yyyy-MM-dd HH:mm:ss" /></p>
				</li>
			</c:forEach>
		</ul>
		</div>
		</div>
		</td>
	</tr>
</table>